﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace HB.HttpServer.Model
{
    public class Method
    {

        // 执行控制器实例
        public object ControllerInstance { get; internal set; }
        public MethodInfo Main { get; internal set; }
        internal MethodInfo Methodinfo { get; set; }

        //路由
        public string Router { get; internal set; } = "/api/[controller]/[action]";

        //支持方法
        public List<string> SupportHttpMethod { get; internal set; } = new List<string>();

        // 权限
        public HttpLicense License { get; internal set; }

        // 执行前检查
        public bool IsFilterIgnore { get; internal set; }

        //频率过滤
        public bool IsFilterIp { get; internal set; } = false;
        public bool IsFilterPublic { get; internal set; } = false;
        internal DateTime LastestAcceptTime { get; set; }
        internal Dictionary<string, DateTime> DicIpAcceptTime;
        internal double FilterFrequency { get; set; }

        //长度过滤
        public bool IsLimitContentLength { get; internal set; } = false;
        public int MaxContentLength { get; internal set; }
    }
}
